case 'operNumber':
  console.log('this.materialTable.dataSource',this.materialTable.dataSource);
  operNumber = value - 0;
  taxRate = row.taxRate - 0 //税率
  unitPrice = row.unitPrice - 0 //单价
  allPrice = (unitPrice * operNumber).toFixed(2) - 0;
  taxUnitPrice = (unitPrice / ((100 + taxRate) / 100)).toFixed(2) - 0;
  taxMoney = (allPrice - taxUnitPrice * operNumber).toFixed(2) - 0
  taxLastMoney = allPrice;
  target.setValues([
    {
      rowKey: row.id,
      values: {
        allPrice: allPrice,
        taxUnitPrice: taxUnitPrice,
        taxMoney: taxMoney,
        taxLastMoney: taxLastMoney
      }
    }
  ])
  console.log(`row.unitPrice:${row.unitPrice}` , `operNumber:${operNumber}`,`allPrice:${allPrice}`)
  // this.form.setFieldsValue({ changeAmount: taxLastMoney })
  target.recalcAllStatisticsColumns()

  that.autoChangePrice(target)
  this.submitBtnDisabled = true;
  if (!operNumber) return
  this.$refs.materialDataTable.getValues((error, values) => {
    console.log(values,'this.$refs.materialDataTable.getValues');
    // this.materialTable.dataSource = values
    let organId = this.form.getFieldValue('organId')
      if (organId) {
      } else {
        organId = ''
      }
      param = {
        materialId: row.materialId,
        allPrice: allPrice
      }

      getDiscount(param).then(res => {
        if (res && res.code === 200) {
          unitPrice = (res.data.allPrice / operNumber).toFixed(2)
          taxUnitPrice = (unitPrice / ((100 + taxRate) / 100)).toFixed(2)
          taxMoney = (res.data.allPrice - taxUnitPrice * operNumber).toFixed(2)
            target.setValues([
              {
                rowKey: row.id,
                values: {
                  taxUnitPrice: taxUnitPrice,
                  taxMoney: taxMoney,
                  allPrice: res.data.allPrice,
                  taxLastMoney: res.data.allPrice,
                  unitPrice: unitPrice,
                  priceNote: res.data.priceNote,
                }
              }
            ])
          // this.form.setFieldsValue({ changeAmount: res.data.allPrice })
          
          target.recalcAllStatisticsColumns()
          that.autoChangePrice(target)
        }
      }).then(()=>{
        if (row.priceNote) {
        } else {
          row.priceNote = ''
        }
        // this.materialTable.dataSource = values
        param = {
          materialId: row.materialId,
          operNumber: operNumber,
          materialUnit: row.unit,
          priceNote: row.priceNote
        }
        // 活动
        getNumber(param).then(res => {
          if (res.data.length !== 0 && res.code === 200) {
            let mList = res.data
            for (let i = 0; i < mList.length; i++) {
              let mInfo = mList[i]
              this.changeColumnShow(mInfo)
              let mObj = this.parseInfoToObj1(mInfo)
              mObj.stock = mInfo.stock
              mObj.materialId = mInfo.id
              mObj.sourceId = mInfo.sourceId
              // 备注
              mObj.remark = mObj.priceNote
              // 供应商
              mObj.supplier = row.supplier

              // 原来的逻辑
              // this.materialTable.dataSource.forEach((item, index) => {
              //   if (
              //     item.priceNote !== '' &&
              //     item.priceNote !== '买满金额减金额' &&
              //     item.materialId == mObj.sourceId
              //   ) {
              //     // 拿到满数量赠品，不懂原来为什么要删除已有的两条数据，而且foreach 后又动态删除
              //     // this.materialTable.dataSource.splice(index, 1, mObj)
              //     this.materialTable.dataSource.splice(index, 1)
              //     // this.materialTable.dataSource.push(mObj)

              //   } else if (row.priceNote == '' && item.materialId == mObj.sourceId) {
              //     this.materialTable.dataSource.push(mObj)
              //   }
              // })

              for(let i=this.materialTable.dataSource.length-1;i>0;i--){
                let item = this.materialTable.dataSource[i]
                if (
                  item.priceNote !== '' &&
                  item.priceNote !== '买满金额减金额' &&
                  item.materialId == mObj.sourceId
                ) {
                  this.materialTable.dataSource.splice(i, 1)
                } 
              }
              this.materialTable.dataSource.push(mObj)
            }
          } else {
            // 原来的逻辑
            // this.materialTable.dataSource.forEach((item, index) => {
            //   if (item.meId == row.meId && item.priceNote == '赠品' && item.priceNote !== '买满金额减金额') {
            //     this.materialTable.dataSource.splice(index, 1)
            //   }
              
            // })
            
            // console.log('没有获取到优惠活动');
            // console.log(this.materialTable,555);
            // 说明：有赠品bug，首先要确保列表中存在priceNote 和 sourceId 字段，否则就会导致新增赠品后，由于获取不到这俩字段的值，无法因数据变更删除赠品
            for(let i=this.materialTable.dataSource.length-1;i>0;i--){
              let item = this.materialTable.dataSource[i]
              delete this.materialTable.dataSource[i].materialId
              if (item.priceNote !== '' &&
              item.priceNote !== '买满金额减金额' &&
              row.materialId == item.sourceId) {
                this.materialTable.dataSource.splice(i, 1)
              }
            }
            console.log(this.materialTable,555);

          }

          getAction('/depot/findDepotByCurrentUser').then(res => {
            if (res.code === 200) {
              let arr = res.data
              for (let i = 0; i < arr.length; i++) {
                if (arr[i].isDefault) {
                  this.$refs.materialDataTable.getValues((error, values) => {
                    values.forEach(item => {
                      if (row.materialId == item.materialId && item.priceNote == '赠品') {
                        // item.depotId = arr[i].id + ''
                        target.setValues([{ rowKey: item.id, values: { depotId: arr[i].id + '' } }])
                      }
                    })
                  })
                }
              }
            }
          })
        })
        this.submitBtnDisabled = false
      })
    
    // target.setValues([
    //   {
    //     rowKey: row.id,
    //     values: { operNumber: operNumber }
    //   }
    // ])
    // console.log(value)
    // console.log(operNumber)

    // alert(row.meId)
    // console.log(values)
  })
  break